test('StringBuilder', function() {
	var sb = new StringBuilder();
	
	var result = sb.ToString();
	
	equals('', result, 'StringBuilder\'s default state is empty string.');
	
	var resultLength = sb.Length();
	
	equals(resultLength, 0, 'StringBuilder\'s default length is 0.');
});

test('StringBuilder.Append', function() {
	var sb = new StringBuilder();
	
	sb.Append('a');
	sb.Append('b');
	
	var result = sb.ToString();
	
	equals(result, 'ab', 'StringBuilder can append simple strings.');
});

test('StringBuilder.AppendLine', function() {
	var sb = new StringBuilder();
	
	sb.AppendLine('a');
	sb.AppendLine('b');
	
	var result = sb.ToString();
	
	equals('a\nb\n', result, 'StringBuilder can append lines.');
});

test('StringBuilder.AppendFormat', function() {
	var sb = new StringBuilder();
	
	sb.AppendFormat('{0}{1}','a','b');
	
	var result = sb.ToString();
	
	equals(result, 'ab', 'StringBuilder and append a formatted string.');
});

test('String.Empty', function() {
	var result = String.Empty;
	
	equals(result, '', 'String.Empty is equal to empty string.');
});

test('String.Format', function() {
	var result = String.Format('{0}{1}','a','b');
	
	equals(result, 'ab', 'String.Format can replace specified format items.');
	
	var result = String.Format('{0,10}','a');
	
	equals(result.length, 10, 'String.Format can apply alignment padding to a string.');
	
	var result = String.Format('{0:C}', 12.945);
	
	equals(result, '$12.95', 'String.Format can format to currency. (Upper-case C)');
	
	var result = String.Format('{0:c}', 12.945);
	
	equals(result, '$12.95', 'String.Format can format to currency. (Lower-case c)');
	 
	raises(function() {
		var failingResult = String.Format('blah {0.0}','blah');
	}, 'String.Format throws exception if unknown format item is provided.');
	
	raises(function() {
		var failingResult = String.Format('{0:c}','NaN');
	}, 'String.Format throws exception if attempt to format non-number as currency.');
});

test('String.Format (Instanced)', function() {
	var testString = '{0}{1}';
	
	var result = testString.Format('a','b');
	
	equals(result, 'ab', 'String.Format (Instanced) can replace specified format items.');
});